var ListItem=require('../../components/ListItem');

class Idiom extends React.Component {
    render(){
        var list=this.props.list||[];
        return (
            <ul className="list margin-0">
                {
                    list.length?list.map((o, i) => {
                        o.index=i+1;
                        o.type='IDIOM';
                        return <ListItem key={i} data={o} onClick={this.props.onClick}/>
                    }):(
                        <li className="item">
                            <div>还没有收藏的成语，去添加一个吧！</div>
                        </li>
                    )
                }
            </ul>
        )
    }
}

module.exports = Idiom;